<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\OrderAddress
 *
 * @property int $id
 * @property int|null $address_id 地址id
 * @property string|null $address_object 地址的序列化 防止用户改变自己的地址
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereAddressId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereAddressObject($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property string|null $consignee
 * @property string|null $country
 * @property string|null $province
 * @property string|null $city
 * @property string|null $district
 * @property string|null $address
 * @property string|null $mobile
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereCity($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereConsignee($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereCountry($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereDistrict($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereMobile($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\OrderAddress whereProvince($value)
 */
class OrderAddress extends Model
{
    //订单地址表
    protected  $table='order_pay_address';
    public function getAddressObjectAttribute($key)
    {
        return json_decode($key,true);
    }
}
